package com.heima.search.controller;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.search.dtos.UserSearchDto;
import com.heima.search.service.SearchArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

/**
 * @author yunfei
 * @date 2022年10月23日 14:55
 */
@RestController
@RequestMapping("/api/v1/associate/")
public class SearchController {

    @Autowired
    private SearchArticleService searchService;

    @PostMapping("search")
    public ResponseResult searchArticle(@RequestBody UserSearchDto searchDto) throws IOException {
        return searchService.searchArticle(searchDto);
    }
}
